<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr = [5,6,7,8,9];
        // 解构语法
        let [a,b,c,d,e] = arr;

        // slice() 方法以新的数组对象，返回数组中被选中的元素。
        console.log(arr.slice(2));//[7,8,9]
        console.log(arr.slice(0,2));//[5,6]

        let [f,g,...rest] = arr;
        console.log(rest);//[7,8,9]

        
    </script>
</body>
</html>